package com.lingyistudio.blog.entity;

import com.lingyistudio.common.entity.BaseEntity;
import lombok.Data;

/**
 * 后端使用
 * @Author :  LingYi
 * @ClassName : BlogBack
 * @Date :   2019/7/29 14:14
 */

@Data
public class BlogBack extends BaseEntity {

    private String blogId;  //文章id
    private String blogHead;  //文章名
    private String blogContent;  //文章内容
    private int blogPermission;  //权限
    private String createdByReal;  //创建人昵称

    private String lastModifiedByReal; //修改人昵称

    private  String customerId; //用户id，redis需要


    public void FrontToBack(BlogFront blogFront){

        this.setBlogId(blogFront.getId());
        this.setBlogHead(blogFront.getBlogTitle());
        this.setBlogContent(blogFront.getBlogText());
        this.setGmtCreate(blogFront.getTime());

        this.setCreatedBy(blogFront.getCreatedBy());
        this.setBlogPermission(blogFront.getPermissionCode());

        this.setVersion(blogFront.getVersion());
    }
}
